const errorHandler = (err, req, res, next) => {
  res.status(500).json({
    success: false,
    message: err.message || '服务器内部错误'
  });
};

module.exports = errorHandler;